// 属性面板的例子
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Fk.RoomElement
Flickable {
   id: root
  anchors.fill: parent
  property var extra_data: ({ name: "", data: {
    propertys: [300, 200, 200,0,0,0,0,0,0],
    skill:{}
  } })

  signal finish()
ColumnLayout {
  id: detail
  anchors.fill: parent
  property var extra_data: parent.extra_data
  signal finish()
  BigGlowText {
    id:titles
    Layout.fillWidth: true
    Layout.preferredHeight: childrenRect.height + 4

    text: Backend.translate(extra_data.name)
  }
  TextEdit {
      id: propertyDesc
      font.pixelSize: 18
      color: "#E4D5A0"

      //anchors.top: detail.centerIn
      Layout.alignment: Qt.AlignHCenter
      horizontalAlignment:TextEdit.AlignHCenter
      readOnly: true
      selectByKeyboard: true
      selectByMouse: false
      wrapMode: TextEdit.WordWrap
      textFormat: TextEdit.RichText
    }
 
  }

  onExtra_dataChanged: {
    if (!extra_data.data) return;
    propertyDesc.text = "";
    const atk=extra_data.data.propertys[0];
    const def=extra_data.data.propertys[1];
    const spd=extra_data.data.propertys[2];
    const atklv=extra_data.data.propertys[3];
    const deflv=extra_data.data.propertys[4];
    const spdlv=extra_data.data.propertys[5];
    const shotlv=extra_data.data.propertys[6];
    const misslv=extra_data.data.propertys[7];
    const critlv=extra_data.data.propertys[8];
      
    propertyDesc.append("攻击" + " " +atk +"  "+"防御" + " " +def+"  "+"速度" + " " +spd);
    propertyDesc.append("\n");
   propertyDesc.append("攻击等级" + " " +atklv +"  "+"防御等级" + " " +deflv+"  "+"速度等级" + " " +spdlv);
    propertyDesc.append("\n");
    propertyDesc.append("命中等级" + " " +shotlv+"  "+"闪避等级" + " " +misslv+"  "+"暴击等级" + " " +critlv);
    propertyDesc.append("\n");
  
  }
}



